<!DOCTYPE html>
<html lang="en">
<head>
<title>Geometry</title>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../../css/bootstrap.min.css">
<link rel="stylesheet" href="../../css/custom.css">
</head>

<body>

<div class="container">
<nav class="navbar">
<a class="btn btn-info btn-xs navbar-btn pull-right m-l" href="../index.html">REST API</a>
<a class="btn btn-info btn-xs navbar-btn pull-right" href="../../index.html">Back to Docs</a>
</nav>

<h1>Geometry</h1>
<p>
<a href=#shape><code>/v3/nc/geometry/:uuid</code></a><br>
<a href=#get-inprocess><code>/v3/nc/geometry/delta/:version</code></a><br>
<a href=#reset-inprocess><code>/v3/nc/geometry/delta/reset</code></a><br>
<a href=#product><code>/v3/nc/geometry/product/:uuid</code></a><br>
<a href=#tool><code>/v3/nc/geometry/tool/:id</code></a></p>

<p>Defined in <a href="https://github.com/steptools/NC.js/blob/master/src/server/api/v3/geometry.js">geometry.js</a></p>


<H2 id="shape">GET Shape Description</H2>

<PRE>GET /v3/nc/geometry/{uuid}</PRE>

<p>The Digital Thread model contains a variety of CAD shapes
associated with different aspects of design and machining process.

GET on the geometry endpoint returns the shape identified by a UUID,
which is described by an <a href="geometry_object.html">array of
geometry objects</a>.  Each object is a shell or polyline annotation.
The shell is a triangular mesh representation of some CAD shape for 3D
display.</p>


<H2 id="get-inprocess">GET In-Process Workpiece Geometry</H2>

<PRE>GET /v3/nc/geometry/delta/{version}
GET /v3/nc/geometry/delta/reset</PRE>

<p>While material removal simulation is ongoing, the server will
transmit <a href="../index.html#delta"><code>nc:delta</code></a>
events to all clients via websocket, telling them about the current
tool position, speeds and feeds, and when new dynamic geometry is
available.

<p>GET on the "geometry/delta" endpoint is used to get the most
current mesh for the in-process workpiece.  The "version" argument for
this call is "-1", which means transmit the entire mesh.

<p>Partial mesh updates are not currently implemented.  When they are,
the version will be the last complete version that the client has and
the faces/points/normals will contain values that must be appended to
the lists in base_version.

<pre>{
   "version":  	   int,
   "precision":    int,
   "base_version": int (currently always zero),
   "faces":        faceRef[],
   "normals":	   int[],
   "points":	   int[],
   "remove":   	   int[] (currently alway empty)
}
</pre>


<table class="table table-striped">
<thead>
<tr><th>Property</th>	<th>Type</th>	<th>Description</th></tr>
</thead>
<tbody>
<tbody>
<tr>
<td>version</td>
<td>integer</td>
<td>This string determines a sequence of delta geometries.</td>
</tr>
<tr>
<td>precision</td>
<td>integer</td>
<td>Factor of ten multiplier.
See <a href="geometry_object.html#mesh">mesh structure</a> for
details.</td>
</tr>
<tr>
<td>base_version</td>
<td>integer</td>
<td>Currently always zero.  When partial updates are enabled, this
will be the number of the last full state. </td>
</tr>
<tr>
<td>faces</td>
<td>FaceRef[]</td>
<td>Faces for the shell.  See <a href="geometry_object.html#mesh">mesh
structure</a> for details. When partial shells are implemented, will
be appended to faces of base version.</td>
</tr>
<tr>
<td>normals</td>
<td>int[]</td>
<td>Vertex normals as a series of IJK values.
See <a href="geometry_object.html#mesh">mesh structure</a> for
details.  When partial shells are implemented, will be appended to
normals of base version.</td>
</tr>
<tr>
<td>points</td>
<td>int[]</td>
<td>Vertex positions as a series of XYZ values.
See <a href="geometry_object.html#mesh">mesh structure</a> for
details. When partial shells are implemented, will be appended to
points of base version.</td>
</tr>
<tr>
<td>remove</td>
<td>int[]</td>
<td>Not currently used, always an empty array.  When partial shells
are implemented, will be the index of facets that should be removed.
Multiplying this value by nine will give the starting index of the
facet in the normal and point arrays.</td>
</tr>

</tbody>
</table>



<H2 id="reset-inprocess">Reset In-Process Workpiece Geometry</H2>

<PRE>GET /v3/nc/geometry/delta/reset</PRE>

<p>Calling GET on this endpoint will reset the in-process geometry
back to the most recent as-is geometry in the STEP-NC process.




<H2 id="product">GET Product Geometry</H2>

<PRE>GET /v3/nc/geometry/product/{uuid}</PRE>

<p>This endpoint returns the geometry for a product with a given ID
using the same shape structure as
the <a href="#shape"><code>/nc/geometry/{uuid}</code></a> endpoint.

<H2 id="tool">GET Tool Geometry</H2>

<PRE>GET /v3/nc/geometry/tool/{id}</PRE>

<p>This endpoint returns the a display list for a cutting tool
assembly as a <a href="state_object.html#key">key state object</a>
containing geometry references for each of the tool components.


<script src="../../js/jquery.min.js"></script>
<script src="../../js/bootstrap.min.js"></script>
</body>
</html>
